<?php

require_once ("GenericDecorator.php");

class Foo {

	private $_int;
	private $_float;

	public function setInt ($value) {
		$this->_int = (int) $value;
	}

	public function setFloat ($value) {
		$this->_float = (float) $value;
	}

	public function getInt () {
		return $this->_int;
	}

	public function getFloat () {
		return $this->_float;
	}

}

class Bar extends GenericDecorator {

	public function getFloat () {
		return (round ($this->obj->getFloat ()));
	}

}

$a = new Foo ();
$a->setInt (1);
$a->setFloat (2.5);

$b = new Bar ($a);

printf ("%s\n", $a->getInt ());
printf ("%s\n", $a->getFloat ());
printf ("%s\n", $b->getInt ());
printf ("%s\n", $b->getFloat ());

$b->setInt (11);
$b->setFloat (12.5);

printf ("%s\n", $a->getInt ());
printf ("%s\n", $a->getFloat ());
printf ("%s\n", $b->getInt ());
printf ("%s\n", $b->getFloat ());

?>
